<template>
  <div class="myheader">
    <!-- 搜索部分 -->
    <el-form
      ref="ruleForm"
      :inline="true"
      :model="search"
      class="demo-form-inline"
    >
      <el-row>
        <el-form-item :label="$t('module')" prop="module">
          <el-select v-model="search.module" clearable filterable>
            <el-option
              v-for="item in moduleList"
              :key="item.name"
              :value="item.name"
              :label="item.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('tableName')" prop="tableName">
          <el-input
            v-model="search.tableName"

            clearable
          />
        </el-form-item>
        <el-form-item :label="$t('version')" prop="version">
          <el-input
            v-model="search.version"

            clearable
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="doSearch">{{ this.$t('search') }}</el-button>
        </el-form-item>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import database from '@/api/system/enum'
export default {
  data() {
    return {
      moduleList: [],
      search: {}
    }
  },
  created() {
    this.getModuleList()
  },
  methods: {
    doSearch() {
      this.$emit('doSearch', this.search)
    },
    getModuleList() {
      database.getList({ enumName: 'BussinessModule' }).then(res => {
        this.moduleList = res.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/defaultStyle.scss";
</style>
<style lang="scss" scoped>
.el-form-item {
  margin-bottom: 0;
}
</style>
